home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / COUPON.TST / CUPNDEFS.H < prev    next >
C/C++ Source or Header  |  1995-12-07  |  2KB  |  70 lines

  1. /* ============ */
  2. /* cupndefs.h    */
  3. /* ============ */
  4. /* ==================================================================== */
  5. /*     TYPEDEFS, #DEFINES AND PROTOTYPES FOR COUPON COLLECTOR'S TEST    */
  6. /* ==================================================================== */
  7. # if defined(__CUPNDEFS_H__)
  8. #    /* Do Nothing */
  9. # else
  10. #    define    __CUPNDEFS_H__
  11.  
  12. # if !defined(__DEFCODES)
  13.  
  14. typedef    unsigned char        UCHAR;
  15. typedef    unsigned int        UINT;
  16.  
  17. #define    FALSE    0
  18. #define    TRUE    1
  19. # endif
  20.  
  21. #define MAX_CELL_XPCT       100
  22. #define MIN_CELL_XPCT         5
  23. #define    MAX_COUPON_LEN       100
  24. #define    MAX_SET_SIZE        25
  25. #define    MIN_SET_SIZE         5
  26. #define    MAX_NUM_COUPONS       32767
  27. #define    MIN_NUM_COUPONS       400
  28.  
  29. /* ------------------- */
  30. /* FUNCTION PROTOTYPES */
  31. /* ------------------- */
  32. # undef F
  33. # if defined(__STDC__) || defined(__PROTO__)
  34. #    define  F( P )  P
  35. # else
  36. #    define  F( P )  ()
  37. # endif
  38.  
  39. /* INDENT OFF */
  40. typedef    struct    CouponDataStru
  41.     {
  42.     int    SetSize;    /* Number Unique Integers in One Coupon */
  43.     int    NumCoupons;    /* Number of Coupons to be Collected    */
  44.     int    UserCellExpect;    /* User-Minimum Cell Expectation    */
  45.     int    MaxCpnLen;    /* Maximum Length of Tallied Segments    */
  46.     int    NumCategories;    /* No. Categories to Receive Tallies    */
  47.     long    TotNumGen;    /* Number Variates Generated This Run    */
  48.     long    UserNumCoupons;    /* No. Coupons to meet UserCellExpect    */
  49.     long    IdealNumCoupons;/* No. Coupons to meet MIN_CELL_XPCT    */
  50.     long    MaxGenPerSeg;    /* FAILURE Criteria for Generator    */
  51.     long    ActMaxPerSeg;    /* Actual Maximum Generated for Segemnt    */
  52.     int    CallStatusOK;    /* 0 = FALSE, 1 = TRUE            */
  53.     int    NotEnough;    /* # Categories < UserCellExpect    */
  54.     double    *CellExpect;    /* Calculated Cell Expectations     */
  55.     double    CouponChiSq;    /* Coupon-Run Chi-Square Data        */
  56.     int    (*RandFun) F((void));/* Addr. of Generating Function    */
  57.     }
  58.     COUPON_DATA_STRU;
  59.  
  60. extern    void    CalcCouponProbs F((int, int, double *));
  61. extern    void    CalcMeanStdDev F((UINT, double *, double *));
  62. extern    void    CalcCouponChiSq F((struct CouponDataStru *));
  63. extern    UINT    GenCouponData F((struct CouponDataStru *));
  64. extern    void    SetCouponControls F((struct CouponDataStru *));
  65.  
  66. # undef F
  67. /* INDENT ON */
  68.  
  69. # endif                /* <<< __CUPNDEFS_H__ >>> */
  70.